<template>
  <div class='pay-success-container'>
    <div class="head">
      <h2>支付</h2>
      <div class="step-container">
        <el-steps :active="2"
                  finish-status="success"
                  align-center>
          <el-step title="确认订单">
          </el-step>
          <el-step title="支付">
          </el-step>
          <el-step title="支付成功">
          </el-step>
        </el-steps>
      </div>
    </div>
    <div class="pay-success">
      <img src="@/assets/pay-success.png"
           alt="">
      <p>支付成功</p>
      <div class="order-info">
        <span>支付方式：支付宝</span>
        <span>支付金额：{{orderResult.pay_price}}元</span>
      </div>
      <div class="btn-group">
        <!-- <button class="check-contract">查看合同</button> -->
        <!-- <button class="apply-invoice">申请发票</button> -->
        <button @click="backOrderList"
                class="back">返回</button>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      orderResult: {},
      uuid: 1
    }
  },
  methods: {
    backOrderList () {
      this.$router.push({
        path: '/orderList',
        query: {
          uuid: this.uuid
        }
      })
    }
  },
  created () {
    this.orderResult = JSON.parse(this.$route.query.orderResult)
    this.orderResult.pay_price = (parseFloat(this.orderResult.pay_money) / 100).toFixed(2)
    this.uuid = this.$route.query.uuid
    console.log(this.uuid)
  },
  mounted () {
  }
}
</script>
<style scoped lang='scss'>
.pay-success-container {
  p {
    margin: 0;
  }
  .head {
    h2 {
      height: 50px;
      padding-left: 20px;
      border-bottom: 1px solid #d9d9d9;
      font-size: 16px;
      color: #1441b3;
      line-height: 50px;
      margin: 0;
    }
    .step-container {
      width: 700px;
      margin: 40px auto 0;
    }
  }
  .pay-success {
    width: 520px;
    margin: 40px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    img {
      width: 96px;
      height: 96px;
    }
    > p {
      font-size: 18px;
      font-weight: bold;

      margin-top: 12px;
      color: #333;
    }
    .order-info {
      width: 520px;
      height: 36px;
      background: #f5f5f5;
      border-radius: 4px;
      margin-top: 20px;
      display: flex;
      padding: 0 90px;
      align-items: center;
      justify-content: space-between;
      box-sizing: border-box;
      span {
        font-size: 14px;
        color: #666;
      }
    }
    .btn-group {
      display: flex;
      margin-top: 40px;
      justify-content: center;
      button {
        width: 96px;
        height: 36px;
        border: 0;
        border-radius: 4px;
        line-height: 32px;
        font-size: 14px;
        cursor: pointer;
        &:not(:last-child) {
          margin-right: 20px;
        }
        &.check-contract {
          background: #fff;
          color: #1890ff;
          border: 1px solid #1890ff;
        }
        &.apply-invoice {
          background: #1890ff;
          color: #fff;
        }
        &.back {
          color: #333;
          width: 68px;
          border: 1px solid #bfbfbf;
          background: #fff;
        }
      }
    }
  }
}
</style>
